const path = require('path');
function resolve(dir) {
  return path.join(__dirname, '.', dir);
}

module.exports = {
    baseUrl: './',
    outputDir: 'dist',
    productionSourceMap: false,
    configureWebpack: {
        devtool: 'source-map'
      },
    lintOnSave:false,
    /* 请求接口代理 */
    devServer: {
        open: true,
        host: '127.0.0.1',
        port: 9091,
        https: false,
        hotOnly: false,
        proxy: null,
        before: app => {
        }
    },
    chainWebpack: config => {
        config.module
          .rule('svg')
          .exclude.add(resolve('src/icons'))
          .end()
       
        config.module
          .rule('icons')
          .test(/\.svg$/)
          .include.add(resolve('src/icons'))
          .end()
          .use('svg-sprite-loader')
          .loader('svg-sprite-loader')
          .options({
            symbolId: 'icon-[name]'
          })
      }
}